home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Parallaxis_20 / prim.p < prev    next >
Text File  |  1990-05-31  |  415b  |  21 lines

  1. SYSTEM sieve;
  2. CONFIGURATION list [200];
  3. CONNECTION  (* none *);
  4.  
  5. SCALAR  prime: integer;
  6. VECTOR  candidate: boolean;
  7.  
  8. BEGIN
  9.    PARALLEL
  10.       candidate := id_no >= 2;
  11.       WHILE candidate DO
  12.          prime:= REDUCE.First(id_no);
  13.          WriteInt(prime,10); WriteLn;
  14.          IF id_no MOD prime = 0       (* remove multiples *)
  15.             THEN candidate := FALSE
  16.          END
  17.       END
  18.    ENDPARALLEL
  19. END sieve.
  20.  
  21.